package com.ireadbooks.service.event;

import org.springframework.context.ApplicationEvent;

/**
 * @program: spring-event-threadpool
 * @description: 订单状态事件
 * @author: wutao
 * @create: 2020/04/04 17:18
 **/
public class OrderStatusEvent extends ApplicationEvent {
    private Integer orderId;
    /**
     * 源状态
     */
    private Integer fromStatus;

    /**
     * 目标状态
     */
    private Integer toStatus;

    /**
     * Create a new ApplicationEvent.
     */
    public OrderStatusEvent(Integer orderId, Integer fromStatus, Integer toStatus) {
        super(orderId);
        this.orderId = orderId;
        this.toStatus = toStatus;
        this.fromStatus = fromStatus;

    }

    public Integer getFromStatus() {
        return fromStatus;
    }

    public void setFromStatus(Integer fromStatus) {
        this.fromStatus = fromStatus;
    }

    public Integer getToStatus() {
        return toStatus;
    }

    public void setToStatus(Integer toStatus) {
        this.toStatus = toStatus;
    }

    public Integer getOrderId() {
        return orderId;
    }

    public void setOrderId(Integer orderId) {
        this.orderId = orderId;
    }

    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer("OrderStatusEvent{");
        sb.append("orderId=").append(orderId);
        sb.append(", fromStatus=").append(fromStatus);
        sb.append(", toStatus=").append(toStatus);
        sb.append('}');
        return sb.toString();
    }
}
